{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 0.36735207\n",
      "200 0.0057397652\n",
      "400 0.005239738\n",
      "600 0.0046996954\n",
      "800 0.004089296\n",
      "1000 0.0034001856\n",
      "1200 0.002665675\n",
      "1400 0.0019653856\n",
      "1600 0.0013884673\n",
      "1800 0.0009800317\n",
      "2000 0.0007269561\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJztnXl4FFX2sN+T0EBYw6ZIAGEUUVEBjcKIGyKLoiwuA4KKK+4LOiiuKIpEkQF/M4yCynwuqIBCRBERBZdBUUBAhRFFXEhQQSGAJECW+/1R3aGXql7SlU53ct7n6SfpureqbnU699x7VjHGoCiKoig+0qp6AIqiKEpyoYJBURRFCUAFg6IoihKACgZFURQlABUMiqIoSgAqGBRFUZQAVDAoiqIoAahgUBRFUQJQwaAoiqIEUKuqB1ARmjdvbtq1a1fVw1AURUkpVq1a9bsxpkWkfikpGNq1a8fKlSurehiKoigphYj8FE0/VSUpiqIoAahgUBRFUQJQwaAoiqIEoIJBURRFCUAFg6IoihKACgZFURQlABUMiqIoSgAqGBRFUZQAVDAoiqIoAahgUBRFUQJQwaAoiqIEoIJBURRFCUAFg6IoihKACgZFURQlgJRMux0vuavzmbhoA1sKimiVmcHovh0Z1DWrqoelKIqSFNQ4wZC7Op+7535FUXEpAPkFRdw99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Rs7AWB6cbY/YlaGxuE+lZGwLHAB94F3AtgfkiMsAYU22qh6kqKTFErI1tjBlujGlrjGkH/B14IRmFQhREfFYRqQ3Mw3rGOQkcm1usADqISHvvswzFem5//D+HC4ElJnWDhiI+r1e9Mg0YYIyxXQykCGGf1Riz0xjT3BjTzvu/uhzrmauNUAAVDIkiYm3sakQ0z/o34DTgchFZ4311qZrhxo7XZnATsAj4HzDbGLNORMaJyABvt+eAZiKyEbid8J5oSU2UzzsRa6c7x/v3DBaUKUGUz1rt0chnRVEUJQDdMSiKoigBqGBQFEVRAlDBoCiKogSggkFRFEUJQAWDoiiKEoAKBkVRFCUAFQyKoihKACoYFEVRlAD+P0vEEEoAdcjUAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#using numpy to create 200 random values\n",
    "x_data = np.linspace(-0.5,0.5,200)[:,np.newaxis]\n",
    "noise = np.random.normal(0,0.02,x_data.shape)\n",
    "y_data = np.square(x_data)+noise\n",
    "\n",
    "#create two placeholders\n",
    "x = tf.placeholder(tf.float32,[None,1])\n",
    "y = tf.placeholder(tf.float32,[None,1])\n",
    "\n",
    "#create hidden layer\n",
    "Weights_L1 = tf.Variable(tf.random.normal([1,10]))\n",
    "biases_L1 = tf.Variable(tf.zeros([1,10]))\n",
    "Wx_plus_b_L1 = tf.matmul(x,Weights_L1) + biases_L1\n",
    "L1 = tf.nn.tanh(Wx_plus_b_L1)\n",
    "\n",
    "#define output layer\n",
    "Weights_L2 = tf.Variable(tf.random.normal([10,1]))\n",
    "biases_L2 = tf.Variable(tf.zeros([1,1]))\n",
    "Wx_plus_b_L2 = tf.matmul(L1,Weights_L2) + biases_L2\n",
    "prediction = tf.nn.tanh(Wx_plus_b_L2)\n",
    "\n",
    "#quadratic cost function\n",
    "loss = tf.reduce_mean(tf.square(y - prediction))\n",
    "#training with gradient descent\n",
    "train_step = tf.train.GradientDescentOptimizer(0.1).minimize(loss)\n",
    "\n",
    "init = tf.global_variables_initializer()\n",
    "\n",
    "with tf.Session() as sess:\n",
    "    sess.run(init)\n",
    "    for step in range(2001):\n",
    "        sess.run(train_step,feed_dict={x:x_data,y:y_data})\n",
    "        if step %200==0:\n",
    "            print(step,sess.run(loss,feed_dict={x:x_data,y:y_data}))\n",
    "\n",
    "    #retrieve prediction values using matplot\n",
    "    prediction_value = sess.run(prediction,feed_dict={x:x_data})\n",
    "    plt.figure()\n",
    "    plt.scatter(x_data,y_data)\n",
    "    plt.plot(x_data,prediction_value,'r-',lw=5)\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
